<html>
<head><meta charset="utf-8"><title>Lint regression on rust-beta · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html">Lint regression on rust-beta</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="181132763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181132763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181132763">(Nov 19 2019 at 17:10)</a>:</h4>
<p>I've found some regression in the <code>unused_parens</code> lint in the current beta release. Now I'm looking for the right place to correctly report that. I've already opened a <a href="https://github.com/rust-lang/rust/issues/66295" target="_blank" title="https://github.com/rust-lang/rust/issues/66295">github issue</a>, but it seems like it's treated merely as issue not regression from stable to beta (according to the labels). Anything else I can do to help getting this fixed?<br>
I would rather not have to handle the fallout on diesel side if this reaches a stable release <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="181134867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181134867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181134867">(Nov 19 2019 at 17:31)</a>:</h4>
<p>I've flagged as a regression</p>



<a name="181134957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181134957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181134957">(Nov 19 2019 at 17:32)</a>:</h4>
<p>we sometimes miss such bugs and don't tag them appropriately, if you notice feel free to raise it here (or in <a class="stream" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler">#t-compiler</a>)</p>



<a name="181138109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181138109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181138109">(Nov 19 2019 at 18:07)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="181812080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181812080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181812080">(Nov 25 2019 at 11:24)</a>:</h4>
<p>If someone has some pointer where to look here I can try to look into this.<br>
(I should probably add that I've never done anything with the lint code in rustc <span aria-label="see no evil" class="emoji emoji-1f648" role="img" title="see no evil">:see_no_evil:</span> )</p>



<a name="181820339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181820339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181820339">(Nov 25 2019 at 13:08)</a>:</h4>
<p>I'd start by grepping: <code>rg -i unused_parens src/libr*</code></p>



<a name="181820385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181820385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181820385">(Nov 25 2019 at 13:08)</a>:</h4>
<p>looks like the lint is implemented here: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L332" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L332">https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L332</a></p>



<a name="181873774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/181873774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#181873774">(Nov 25 2019 at 23:11)</a>:</h4>
<p>I assume I can fix that case by adding something <a href="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L527-L533" target="_blank" title="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L527-L533">like this</a> <a href="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L584" target="_blank" title="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L584">here?</a></p>



<a name="182057515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/182057515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#182057515">(Nov 27 2019 at 20:49)</a>:</h4>
<p>Turns out this does not work. From looking around a bit further it seems like <a href="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L358-L359" target="_blank" title="https://github.com/rust-lang/rust/blob/a44774c3a9739b2eea8923e09d67b14312c78ef3/src/librustc_lint/unused.rs#L358-L359">this</a> condition needs to be changed to check also if we are not inside a macro. Unfortunately I'm missing the required knowledge how to do that. Does anyone have a pointer where to look for a method that could be useful here?<br>
Things I've already tried out naively because I've saw the somewhere in that file:</p>
<ul>
<li>Checking <code>inner.span.from_expansion()</code></li>
<li>Checking <code>inner.span.ctxt().outer_expn_data().call_site.from_expansion()</code></li>
<li>Checking <code>inner.span.macro_backtrace()</code></li>
</ul>



<a name="182565574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Lint%20regression%20on%20rust-beta/near/182565574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> weiznich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Lint.20regression.20on.20rust-beta.html#182565574">(Dec 04 2019 at 15:23)</a>:</h4>
<p>I've opened <a href="https://github.com/rust-lang/rust/pull/66983" target="_blank" title="https://github.com/rust-lang/rust/pull/66983">#66983</a> to fix this, but I'm not sure how to handle the test failure there.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>